/*
 * Copyright (c) 2005 -2008 Reliable Source, Inc. and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Mozilla Public License v.1.1,
 * BSD, and Eclipse Public License v1.0 which accompanies this
 * distribution and is available at:
 *
 * 		http://www.eclipse.org/legal/epl-v10.html
 * 		http://www.opensource.org/licenses/bsd-license.php
 * 		http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * Contributors:
 *     IBM Corporation	     -  http://ibm.com
 *     	- initial API and implementation
 *
 *     Reliable Source, Inc. - http://reliablesource.org
 *
 */
package org.reliablesource.client.ui.viewers;

import org.eclipse.jface.viewers.ContentViewer;
import org.eclipse.jface.viewers.IInputSelectionProvider;
import org.eclipse.jface.viewers.IOpenListener;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.reliablesource.model.core.IDisposable;


/**
 * 
 * IReliableViewer.java<br>
 * Created on: Apr 19, 2007 <br>
 * 
 * Object instances of this type represent some UI control abstraction.
 * 
 * It is the responsibility of the parent container to call the Lifecycle
 * methods for objects of this type.
 *
 * @author <a href="mailto:dennis.park@gmail.com">Dennis Park</a>
 *
 * @category
 * @since 1.0
 */
public interface IReliableViewer extends IInputSelectionProvider, IDisposable {

	public Control getControl();

	public void refresh();

	public void setInput(Object _input);

	/**
	 * This lifecycle method is called by the container. After the constructor
	 * (0 arg), but before the <code>createViewerControl</code> is called.
	 * 
	 * @category lifecycle
	 */
	public void init();

	/**
	 * 
	 * 
	 * After the init, but before <code>setInput</code>, the Control for this
	 * viewer is created.
	 * 
	 * @param _parent
	 * @category lifecycle
	 */
	public void createViewerControl(Composite _parent);

	/**
	 * 
	 * @return
	 * @category getter
	 */
	public Viewer[] getChildren();
	
	/**
	 * 
	 * @param _child
	 * @return
	 */
	public boolean addChild(ContentViewer _child);
	
	/**
	 * 
	 * @param _child
	 * @return
	 */
	public boolean removeChild(ContentViewer _child);
	
	/**
	 * @return the top-level <code>Viewer</code>
	 * @category getter
	 */
	public Viewer getContentViewer();
	
	public void addOpenListener(IOpenListener _listener);
	public boolean setFocus();
}
